package sicau.practice.community.Mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import sicau.practice.community.model.Realuser;
import sicau.practice.community.model.User;

import java.util.List;

@Mapper
public interface UserMapper {
    @Insert("insert into user (accountId,name) values (#{accountId},#{name})")
    void insert(User user);

    @Select("select * from user ")
    List<User> listAll();


    @Select("select * from realuser where username=#{username} and password=#{password} ")
    List<Realuser> login(@Param("username") String username,@Param("password") String password);

}
